#include "coordinatehelpdialog.h"
#include "ui_coordinatehelpdialog.h"

CoordinateHelpDialog::CoordinateHelpDialog(int styleId,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CoordinateHelpDialog)
{
    ui->setupUi(this);
    setWindowFlags(Qt::FramelessWindowHint);
    move(0,0);
    initialDisplayStyle(styleId);
    on_comboBox_type_activated(0);
}

CoordinateHelpDialog::~CoordinateHelpDialog()
{
    delete ui;
}


void CoordinateHelpDialog::initialDisplayStyle(int styleId)
{
    switch (styleId) {
    case 1:
        this->setGeometry(0,0,600,450);
        break;
    default:
        break;
    }
}

void CoordinateHelpDialog::on_comboBox_type_activated(int index)
{
    switch(index)
    {
    case 0:
        ui->label_help->setStyleSheet("image: url(/agvwork/AgvHmi/baseBag/hmiProject/resources/HomeMenuresources/u3.png);");
        ui->textEdit_help->setText("P1:原点\n"
                                   "P2:X方向点\n"
                                   "P3:Y方向点");
        break;
    case 1:
        ui->label_help->setStyleSheet("image: url(/agvwork/AgvHmi/baseBag/hmiProject/resources/HomeMenuresources/u4.png);");
        ui->textEdit_help->setText("P1:参考点\n"
                                   "P2:X方向点\n"
                                   "P3:Y方向点\n"
                                   "P4:原点");
        break;
    case 2:
        ui->label_help->setStyleSheet("image: url(/agvwork/AgvHmi/baseBag/hmiProject/resources/HomeMenuresources/toolset.png);");
        ui->textEdit_help->setText("P1:第１尖点\n"
                                   "P2:第２尖点\n"
                                   "P3:第３尖点\n"
                                   "要求任意两个尖点的世界坐标系下的wpr相互角度偏差大于35度");
        break;
    case 3:
        ui->label_help->setStyleSheet("image: url(/agvwork/AgvHmi/baseBag/hmiProject/resources/HomeMenuresources/t6.png);");
        ui->textEdit_help->setText("P1:第１尖点\n"
                                   "P2:第２尖点\n"
                                   "P3:第３尖点\n"
                                   "P4:姿态参考点\n"
                                   "P5:姿态X方向点\n"
                                   "P6:姿态Z方向点");
        break;
    case 4:
        ui->label_help->setStyleSheet("image: url(/agvwork/AgvHmi/baseBag/hmiProject/resources/HomeMenuresources/toolset.png);");
        ui->textEdit_help->setText("P1-P20:总共20个尖点，要求相邻3个尖点的wpr相互偏差差大于15度");
        break;
    case 5:
        ui->label_help->setStyleSheet("image: url(/agvwork/AgvHmi/baseBag/hmiProject/resources/HomeMenuresources/toolset.png);");
        ui->textEdit_help->setText("P1-P20:总共20个尖点，要求相邻3个尖点的世界坐标系下wpr相互角度偏差大于15度\n"
                                   "P21:姿态参考点\n"
                                   "P22:姿态X方向点\n"
                                   "P23:姿态Z方向点");
        break;
    case 6:
        ui->label_help->setStyleSheet("image: url(/agvwork/AgvHmi/baseBag/hmiProject/resources/HomeMenuresources/toolset.png);");
        ui->textEdit_help->setText("P1-P20:总共20个尖点，要求相邻3个尖点的世界坐标系下wpr相互角度偏差大于15度\n"
                                   "该方法用于修正机械原点偏差，计算时间比较长，大约要几分钟才能结束，根据消息页面的消息来判断计算结束与否");
        break;
    }
}

void CoordinateHelpDialog::on_forward_Btn_clicked()
{
    hide();
}
